# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/10/27 17:47
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : laplace_sharp.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from skimage.io import imread
from skimage import filters
from DIP_experiment_5.util import contrast_show

# 以灰度图形式读入图像
im_path = "../experiment_fig/beans.png"
im = imread(im_path, as_gray=True)  # 读取后图像已经归一化到[0.0,1.0]
font_path = "C:/Windows/Fonts/simhei.ttf"
# 使用拉普拉斯算子提取边缘
laplace_edge = filters.laplace(im)*10
sharp_im = im + laplace_edge
im_dict = {"原始图像": im, "锐化图像": sharp_im, "边缘图像": laplace_edge}
contrast_show(im_dict, (1, 3),wspace=0.4, font=font_path)
